import React, { Component } from 'react'
import Dialog from '../Dialog'
import './index.css'
export default class TabContent extends Component {
  constructor() {
    super()
    this.state = {
      isShow: false, //控制弹窗显示隐藏开关
    }
  }
  render() {
    const { list, activeId } = this.props
    return (
      <div>
        <ul>
          {list
            .find((item) => item.id === activeId)
            .children.map((val) => {
              return (
                <li
                  key={val.cId}
                  onClick={() => {
                    this.setState({ isShow: true })
                  }}>
                  {val.title}
                </li>
              )
            })}
        </ul>
        <Dialog
          isShow={this.state.isShow}
          changeState={() => {
            this.setState({ isShow: false })
          }}></Dialog>
      </div>
    )
  }
}
